package org.dei.perla.rockfall.gui.queryforge.panels;

import java.util.Arrays;

import javax.swing.JTextArea;

import org.dei.perla.rockfall.gui.queryforge.DSPicParameters;
import org.dei.perla.rockfall.gui.queryforge.ReadableStatusPanel;

public class FilterXStatusPanel extends ReadableStatusPanel {

	
	private DSPicParameters parameters;
	private JTextArea textArea;

	public FilterXStatusPanel(String string, DSPicParameters parameters) {
		super(string);
		this.parameters = parameters;
		this.textArea = new JTextArea();
		this.textArea.setEditable(false);
		if(parameters.getTapsx() != null)
			this.textArea.setText(Arrays.toString(parameters.getTapsx()));

		this.add(textArea);
	}

	@Override
	protected int getStatus() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	protected void setStatus(int stato) {
		// TODO Auto-generated method stub

	}

	@Override
	protected void setupInternalComponents() {
		// TODO Auto-generated method stub

	}

	public void updateConfiguration() {
		if(parameters.getTapsx() != null){
			int array[] = parameters.getTapsx();
			String filter = new String();
			for(int i = 0; i < array.length ; i++){
				filter = filter.concat("tapsx[" + i + "] =\t" + array[i] + "\n");
			}
			this.textArea.setText(filter);
		}
			
	}

}
